package com.ly.service;


import com.ly.bean.EasybuyUser;
import com.ly.bean.EasybuyUserAddress;
import com.ly.bean.Result;
import com.ly.bean.UserVip;

import java.util.List;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
public interface UserService {
    /**
     * 根据用户名查询用户信息 登录验证
     */
    EasybuyUser selectUserByName(String loginname) throws Exception;
    /**
     * 把用户对象存到redis中
     */
    void saveLoginUserToRedis(EasybuyUser easybuyUser,String uuid) throws Exception;
    /**
     * 根据uuid从redis查询用户，验证是否登录
     */
    EasybuyUser findUserByRedis(String uuid) throws Exception;
    /**
     * 根据用户id获取用户的地址
     */
    List<EasybuyUserAddress> selectUserAdressByUid(Integer uid) throws Exception;
    /*
     *       根据用户id来判断是否是vip
     */
    int findUserVipByuid(UserVip userVip) throws Exception;

    //添加新的收货地址
    void addUserAddress(EasybuyUserAddress userAddress) throws Exception;

    /**
     * 注册的时候添加用户信息
     */
    public int addUser(EasybuyUser user) throws Exception;

    /*
    * 用户激活以后修改用户的状态
    * */
    public void updateUser(EasybuyUser user) throws Exception;

    /*
    根据用户id查询用户对象
    * */
    EasybuyUser selectByPrimaryKey(Integer uid) throws Exception;
}
